import Vue from 'vue';
import Big from 'big.js';

Vue.mixin({
    name:"mixin",
    data(){
        return{

        }
    },
    methods:{
        changeTest(value){
          console.log('下拉框的值为',value);
        },
        amountBig(type,num1,num2,length=2){
            let numOne=this.getBig(num1);
            let numTwo=this.getBig(num2);
            let typeVal=type;
            switch(type){
                case '+':
                    'plus';
                    break;
                case '-': 
                    'mimus';
                    break;
            }
           // return this.amountFormatForeign(Number(numOne[typeVal](numTwo)),length===0 || length==='JPY' ? 'JPY' : length);
           return num1+num2;
           },
    
         getBig(value) {
            let num=Number(value);
            if(typeof(value)!=='number' && num!='NaN'){
                num=0;
            }
            return new Big(num);
           } 
    }
})